using System.Collections;
using System.Collections.Generic;
using System.IO;
using UnityEngine;

public static class StringExtension
{
    public static string ToAssetsPath(this string self)
    {
        var assetFullPath = Path.GetFullPath(Application.dataPath);

        return "Assets" + Path.GetFullPath(self).Substring(assetFullPath.Length).Replace("\\", "/");
    }

    public static bool IsDirectory(this string self)
    {
        FileInfo fileInfo = new FileInfo(self);
        if ((fileInfo.Attributes & FileAttributes.Directory) != 0)
        {
            return true;
        }

        return false;
    }
}